package com.yanqu.road.entity.travelbook;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author : Cxp
 * @Time : 2024-11-11
 * @Description : 用户卡册
 */

@FieldTypeAnnotation(tableName = "t_u_travel_album", autoSave = true, desc = "旅行卡册数据")
public class UserTravelAlbum extends DataObject {

    @FieldTypeAnnotation(desc = "用户Id", select = true, update = true)
    private long userId;

    @FieldTypeAnnotation(desc = "卡册Id", select = true, update = true)
    private int albumId;

    @FieldTypeAnnotation(desc = "美女Id")
    private int beautyId;

    @FieldTypeAnnotation(desc = "技能等级")
    private int level;

    @FieldTypeAnnotation(desc = "卡牌")
    private List<UserTravelCard> cards;

    public UserTravelAlbum() {}

    public UserTravelAlbum(long userId, int albumId, int beautyId, int level, List<UserTravelCard> cards) {
        this.userId = userId;
        this.albumId = albumId;
        this.beautyId = beautyId;
        this.level = level;
        this.cards = cards;
        setInsertOption();
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public int getAlbumId() {
        return albumId;
    }

    public void setAlbumId(int albumId) {
        if (this.albumId != albumId) {
            this.albumId = albumId;
            setOp(DataStatus.Update);
        }
    }

    public int getBeautyId() {
        return beautyId;
    }

    public void setBeautyId(int beautyId) {
        if (this.beautyId != beautyId) {
            this.beautyId = beautyId;
            setOp(DataStatus.Update);
        }
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        if (this.level != level) {
            this.level = level;
            setOp(DataStatus.Update);
        }
    }

    public List<UserTravelCard> getCards() {
        if (cards == null) {
            return new ArrayList<>();
        }
        return cards;
    }

    public void setCards(List<UserTravelCard> cards) {
        if (this.cards != cards) {
            this.cards = cards;
            setOp(DataStatus.Update);
        }
    }
}